package com.kexio.enterprise.governance.circuitbreaker.listener;

import com.kexio.enterprise.governance.circuitbreaker.enums.CircuitBreakerState;

/**
 * 熔断器状态变化监听器
 * 
 * @author Kexio
 * @since 1.0.0
 */
@FunctionalInterface
public interface CircuitBreakerStateChangeListener {
    /**
     * 状态变化时调用
     * 
     * @param key      熔断器键
     * @param oldState 旧状态
     * @param newState 新状态
     */
    void onStateChange(String key, CircuitBreakerState oldState, CircuitBreakerState newState);
}
